﻿@* Generator: Template
    GeneratePrettyNames : true *@
@functions{
    public NFinal.Compile.Template.App.Code.Data.SessionManagerModel Model { get; set; }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace @{@Model.project}.@{@Model.app}.Code.Data
{
    public class SessionManager:NFinal.Session
    {
		private SessionInfo _sessionInfo;
		public SessionManager(string session_id,NFinal.ICache cache):base(session_id, cache)
        {
            this.sessionId = session_id;
            _sessionInfo = new SessionInfo();
        }
		@foreach(var declaraton in Model.declarations){
        @:public @{@declaraton.typeName} @{@declaraton.varName}
        @:{
            @:get 
			@:{
				@:_sessionInfo.@{@declaraton.varName} = this.Get<@{@declaraton.typeName}>("@{@Model.sessionPrefix}@{@declaraton.varName}");
                @:return _sessionInfo.@{@declaraton.varName};
            @:}
            @:set 
			@:{
				@:_sessionInfo.@{@declaraton.varName} = value;
                @:this.Set<@{@declaraton.typeName}>("@{@Model.sessionPrefix}@{@declaraton.varName}", _sessionInfo.@{@declaraton.varName});
            @:}
        @:}
        }
    }
}